package org.cuit.epoch.seon.top;

// 叶子节点 - 文件
class File implements FileSystemComponent {
    private String name;
    private int size; // 文件大小，以KB为单位

    public File(String name, int size) {
        this.name = name;
        this.size = size;
    }

    @Override
    public void showDetails(String indent) {
        System.out.println(indent + "File: " + name + " (" + size + " KB)");
    }

    @Override
    public int getSize() {
        return size;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void rename(String newName) {
        this.name = newName;
    }

    @Override
    public void delete() {
        // File deletion logic can be extended as needed
        System.out.println("Deleting file: " + name);
    }
}